xend: pass-through: Use generic code in pci_opts_list_to_sxp()
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 17 Jun 2009 06:37:26 +0000 (07:37 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 17 Jun 2009 06:37:26 +0000 (07:37 +0100)
Use dev_dict_to_sxp() inside pci_opts_list_to_sxp() now that it is
available.

Signed-off-by: Simon Horman <horms@verge.net.au>
tools/python/xen/util/pci.py
tools/python/xen/xend/XendSXPDev.py

index 604cff589a7827b2f7b89000883d732279b09f1d..260ad7f2a945855786ee72364f25563baef5fdce 100644 (file)
@@ -136,7 +136,7 @@ def split_pci_opts(opts):
                filter(lambda x: x != '', opts.split(',')))
 
 def pci_opts_list_to_sxp(list):
-    return ['dev'] + map(lambda x: ['opts', x], list)
+    return dev_dict_to_sxp({'opts': list})
 
 def pci_opts_list_from_sxp(dev):
     return map(lambda x: sxp.children(x)[0], sxp.children(dev, 'opts'))
index dac5e6c3b0536b6f41580507c39b8bcee8b026c5..f145701ea8c4078085dcd8669035d199b76a01eb 100644 (file)
@@ -4,7 +4,6 @@
 
 import types
 
-# This includes a generic equivalent of pci_opts_list_to_sxp()
 def dev_dict_to_sxp(dev):
     def f((key, val)):
         if isinstance(val, types.ListType):